{%  extends 'base.html' %}
{% load tags %}

{% block body %}
<body>

<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Oldboy PefectCRM</a>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
      <ul class="nav navbar-nav navbar-right">

        <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">{{ request.user.name }} <span class="caret"></span></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="#">配置</a></li>
                <li><a href="{% url 'acc_logout' %}">注销</a></li>
              </ul>
        </li>

      </ul>

    </div>
  </div>
</nav>

<div class="container " style="margin: 50px;width: auto">
    {% block container %}
    <div class="row">
        <div class="panel panel-info">
          <div class="panel-heading">
            <h3 class="panel-title">Panel title</h3>
          </div>
          <div class="panel-body">
            {{ table_list }}
              {% for app_name,app_tables in table_list.items %}

                 <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>{{ app_name }}</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for table_name,admin  in app_tables.items %}
                            <tr>
                                <td>
                                    <a href="{% url 'table_objs' app_name table_name %}">
                                       {% render_app_name admin %}
                                    </a>
                                </td>
                                <td>add</td>
                                <td>change</td>
                            </tr>
                        {% endfor %}
                    </tbody>
                 </table>
              {% endfor %}

          </div>
        </div>
    </div>
    {% endblock %}
</div>


</body>

{% endblock %}